package pt.ipl.isel.deetc.leic.pdm.g12.yamba;

import android.app.IntentService;
import android.content.Intent;

public class StatusUploadService extends IntentService {
	public static final String ARG_KEY = "arg";
	
	public StatusUploadService() {	
		super("StatusUploadService");	
	}
	
	@Override
	protected void onHandleIntent(Intent intent) {
		
		action(intent);
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
	}
	
	private void action(Intent intent) {		
		YambaPdmApp yamba = (YambaPdmApp) getApplication(); 
		yamba.getTwitter().updateStatus(intent.getStringExtra(ARG_KEY));
	}
}
